﻿<UserControl x:Class="SPNetworkTopology.ExternalWindows.View.DataLinkingView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModel="clr-namespace:SPNetworkTopology.ExternalWindows.ViewModel"
             xmlns:view ="clr-namespace:SPNetworkTopology.ExternalWindows.View"
             mc:Ignorable="d" 
             >
    <UserControl.Resources>
        <DataTemplate DataType="{x:Type viewModel:WelcomePageViewModel}">
            <view:WelcomePageView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type viewModel:SPListInputViewModel}">
            <view:SPListInputView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type viewModel:SPColumnSelectionViewModel}">
            <view:SPColumnSelectionView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type viewModel:SPListSummaryViewModel}">
            <view:SPListSummaryView />
        </DataTemplate>

        <Style TargetType="{x:Type Button}">
            <Setter Property="Padding" Value="3.5,0" />
            <Setter Property="Margin" Value="3.5" />
            <Setter Property="MinWidth" Value="80" />
        </Style>

        <!-- This Style inherits from the Button style seen above. -->
        <Style BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type Button}" x:Key="moveNextButtonStyle">
            <Setter Property="Content" Value="_Next" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=IsOnLastPage}" Value="True">
                    <Setter Property="Content" Value="_Finish" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>

    <Grid Margin="1">
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <!--Header Section-->
        <Border BorderThickness="1" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="2" TextBlock.FontWeight="Bold" TextBlock.FontSize="18" TextBlock.TextAlignment="Center" d:IsHidden="True">
            <Border.Background>
                <LinearGradientBrush EndPoint="1.15,1.2" MappingMode="RelativeToBoundingBox" StartPoint="-0.146,-0.146">
                    <GradientStop Color="#FFF1DBC3" Offset="0.352"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.607"/>
                    <GradientStop Color="#FFEFC191" Offset="0.104"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.927"/>
                </LinearGradientBrush>
            </Border.Background>
            <TextBlock Text="{Binding Path=CurrentPage.DisplayName}" TextAlignment="Center" FontSize="18" FontWeight="Bold" Margin="10">
            </TextBlock>
        </Border>

        <!--Body Section-->
        <Border BorderThickness="0.75" Grid.Row="1" Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="1" d:IsHidden="True">
            <Border.Background>
                <LinearGradientBrush EndPoint="1.15,1.2" MappingMode="RelativeToBoundingBox" StartPoint="-0.146,-0.146">
                    <GradientStop Color="#FFF1DBC3" Offset="0.352"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.607"/>
                    <GradientStop Color="#FFEFC191" Offset="0.104"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.927"/>
                </LinearGradientBrush>
            </Border.Background>
            <Image Source="/SPNetworkTopology;component/ExternalWindows/View/Images/data.png"></Image>
        </Border>

        <Border BorderThickness="0.75" Grid.Row="1" Grid.RowSpan="1" Grid.Column="1" Grid.ColumnSpan="1" Padding="5">
            <Border.Background>
                <LinearGradientBrush EndPoint="1.15,1.2" MappingMode="RelativeToBoundingBox" StartPoint="-0.146,-0.146">
                    <GradientStop Color="#FFF1DBC3" Offset="0.352"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.607"/>
                    <GradientStop Color="#FFEFC191" Offset="0.104"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.927"/>
                </LinearGradientBrush>
            </Border.Background>
            <HeaderedContentControl Content="{Binding Path=CurrentPage}" VerticalContentAlignment="Stretch" />
        </Border>

        <!--Footer Section-->
        <Border BorderThickness=".75" Grid.Row="2" Grid.RowSpan="1" Grid.Column="2" d:IsHidden="True">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="2" Grid.IsSharedSizeScope="True" HorizontalAlignment="Right">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition SharedSizeGroup="Buttons" />
                        <ColumnDefinition Width="11" />
                        <ColumnDefinition SharedSizeGroup="Buttons" />
                        <ColumnDefinition Width="11" />
                        <ColumnDefinition SharedSizeGroup="Buttons" />
                    </Grid.ColumnDefinitions>

                    <Button Grid.Column="0" Command="{Binding Path=MovePreviousCommand}" Content="_Previous" />
                    <Button Grid.Column="2" Command="{Binding Path=MoveNextCommand}" Style="{StaticResource moveNextButtonStyle}" IsDefault="True" />
                    <Button Grid.Column="4" Command="{Binding Path=CancelCommand}" Content="_Cancel" IsCancel="True" />

                </Grid>
            </Grid>
        </Border>

    </Grid>
</UserControl>
